/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package homeworkhelp;

import homeworkhelp.gui.testWin;

/**
 *
 * @author Trevor
 */
public class HomeworkHelp {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        testWin win = new testWin();
        win.setVisible(true);
        
        /*EntityManagerFactory emf = Persistence.createEntityManagerFactory("homeworkhelp.odb");


        EntityManager em = emf.createEntityManager();
        List<Semester> semResults = Collections.EMPTY_LIST;
        TypedQuery<Semester> query =
                em.createQuery("SELECT sem FROM Semester sem", Semester.class);
        semResults = query.getResultList();
        if (semResults.size() < 1) {

            em.getTransaction().begin();

            Semester sem = new Semester();
            sem.name = "Test Semester";
            Calendar cal = Calendar.getInstance(TimeZone.getDefault());
            cal.add(Calendar.WEEK_OF_YEAR, -1);
            sem.startDate = cal.getTime();

            cal.add(Calendar.WEEK_OF_YEAR, 20);
            sem.endDate = cal.getTime();
            
            Course course = new Course();
            course.name = "test course";
            course.addSemester(sem);
            
            Course course2 = new Course();
            course2.name = "test course2";
            course2.addSemester(sem);
            
            em.persist(course);
            em.persist(course2);            
            
            sem.addCourse(course);
            sem.addCourse(course2);
            
            em.persist(sem);

            em.getTransaction().commit();

            System.out.println("Created new Semester");
        } else {
            for (Semester sem : semResults) {
                System.out.println(sem.id);
                System.out.println(sem.name);
                System.out.println(sem.startDate);
                System.out.println(sem.endDate);
                System.out.println(sem.findCourseById(1));
                System.out.println(sem.findCourseByName("test course2"));
            }
        }
        
        em.close();
        emf.close();*/
    }
}
